package cn.iocoder.an.module.business.controller.admin.equipmentmanage.vo;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.*;

import jakarta.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import static cn.iocoder.an.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static cn.iocoder.an.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 设备台账新增/修改 Request VO")
@Data
public class EquipmentManageSaveReqVO {

    private Long id;

    @Schema(description = "设备编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "9336")
    private String code;

    @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @NotEmpty(message = "设备名称不能为空")
    private String equipmentName;

    @Schema(description = "所属部门", example = "14770")
    private Long deptId;

    @Schema(description = "所属部门名称", example = "开发部")
    private String deptName;

    @Schema(description = "设备分类")
    private Long equipmentClassify;

    @Schema(description = "设备分类名称")
    private String equipmentClassifyName;

    @Schema(description = "设备状态", example = "2")
    private Integer equipmentStatus;

    @Schema(description = "设备类型", example = "1")
    private Integer equipmentType;

    @Schema(description = "规格型号")
    private String equipmentModel;

    @Schema(description = "设备功率kw")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal equipmentPower;

    @Schema(description = "设备重量")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal equipmentWeight;

    @Schema(description = "设备吨位")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal equipmentTonnage;

    @Schema(description = "安装位置")
    private String installPosition;

    @Schema(description = "安装日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date installDate;

    @Schema(description = "投产日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date productionDate;

    @Schema(description = "单位")
    private String unit;

    @Schema(description = "设备厂家")
    private String equipmentProducer;

    @Schema(description = "联系人")
    private String contacts;

    @Schema(description = "联系电话")
    private String contactsNumber;

    @Schema(description = "使用状态", example = "2")
    private Integer useType;

    @Schema(description = "最近一次保养时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime maintainDatetime;

    @Schema(description = "下次保养时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime nextMaintainDatetime;

    @Schema(description = "备注", example = "你说的对")
    private String remark;

    //维护人员
    private List<Long> maintenanceUserId;

    //维护人员
    private String maintenanceUserName;


    /**
     * 最近一次维护时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastMaintainTimeDamage;
    /**
     * 下次维护时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime nextMaintainTimeDamage;

    //易损品维护人员
    private List<Long> maintenanceUserIdDamage;

    //易损品维护人员
    private String maintenanceUserNameDamage;


}